home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-14 | 4.8 KB | 130 lines | [TEXT/CCL2] |
- (in-package :oou)
- (oou-provide :QuickTime-vd)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; QuickTime-vd.lisp
- ;;
- ;; Copyright © 1992 Northwestern University Institute for the Learning Sciences
- ;; All Rights Reserved
- ;;
- ;; author: Michael S. Engber
- ;;
- ;; object for controling a video digitizer with a QuickTime component
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (oou-dependencies :video-digitizer
- :traps-u)
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defun qtvd-avail-p (&key
- (component-subtype #$kAnyComponentSubtype)
- (component-manufacturer #$kAnyComponentManufacturer)
- (component-flags 0)
- (component-flags-mask #$kAnyComponentFlagsMask))
- (rlet ((looking :ComponentDescription
- :componentType #$videoDigitizerComponentType
- :componentSubtype component-subtype
- :componentManufacturer component-manufacturer
- :componentFlags component-flags
- :componentFlagsMask component-flags-mask))
- (plusp (#_CountComponents looking))))
-
- ;(qtvd-avail-p)
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defclass QuickTime-vd (video-digitizer)
- ((component :accessor component
- :allocation :class)
- (component-instance :accessor component-instance
- :allocation :class)
- (ref-count :accessor ref-count
- :initform 0
- :allocation :class)
- (component-subtype :accessor component-subtype
- :initarg :component-subtype)
- (component-manufacturer :accessor component-manufacturer
- :initarg :component-manufacturer)
- (component-flags :accessor component-flags
- :initarg :component-flags)
- (component-flags-mask :accessor component-flags-mask
- :initarg :component-flags-mask)
-
-
- )
- (:default-initargs
- :component-subtype #$kAnyComponentSubtype
- :component-manufacturer #$kAnyComponentManufacturer
- :component-flags #$kAnyComponentFlagsMask
- :component-flags-mask #$kAnyComponentFlagsMask
- ))
-
-
- (defmethod initialize-instance :after ((vd QuickTime-vd) &rest initargs)
- (declare (ignore initargs))
- (rlet ((looking :ComponentDescription
- :componentType #$videoDigitizerComponentType
- :componentSubtype (component-subtype vd)
- :componentManufacturer (component-manufacturer vd)
- :componentFlags (component-flags vd)
- :componentFlagsMask (component-flags-mask vd)))
- (let ((component (#_FindNextComponent (%null-ptr) looking)))
- (when (%null-ptr-p component) (error "Unable to find requested digitizer component."))
- (setf (component vd) component))))
-
- (defmethod vd-init :before ((vd QuickTime-vd))
- (unless (wptr-color-p (dest-wptr vd)) (error "QT vdigs require color ports."))
- (when (zerop (slot-value vd 'ref-count))
- (let ((ci (#_OpenComponent (component vd))))
- (when (%null-ptr-p ci) (error "Unable to open digitizer component."))
- (setf (component-instance vd) ci)))
- (incf (slot-value vd 'ref-count)))
-
- (defmethod vd-dispose :after ((vd QuickTime-vd))
- (when (plusp (ref-count vd))
- (decf (ref-count vd))
- (when (zerop (ref-count vd))
- (let ((ci (component-instance vd)))
- (slot-makunbound vd 'component-instance)
- (trap-nz-echeck (#_CloseComponent ci))))))
-
- (defmethod vd-GDevice ((vd QuickTime-vd))
- (rlet ((dig-info :DigitizerInfo))
- (trap-nz-echeck (#_VDGetDigitizerInfo (component-instance vd) dig-info))
- (pref dig-info :DigitizerInfo.gdh)))
-
- (defmethod vd-max-src-rect-corners ((vd QuickTime-vd))
- (rlet ((r :Rect))
- (trap-nz-echeck (#_VDGetMaxSrcRect (component-instance vd) #$ntscIn r))
- (values (pref r :Rect.topLeft) (pref r :Rect.botRight))))
-
- (defmethod vd-start-digitizing :after ((vd QuickTime-vd))
- (trap-nz-echeck (#_VDSetPlayThruOnOff (component-instance vd) #$vdPlayThruOn)))
-
- (defmethod vd-stop-digitizing :after ((vd QuickTime-vd))
- (trap-nz-echeck (#_VDSetPlayThruOnOff (component-instance vd) #$vdPlayThruOff)))
-
-
- (defmethod vd-grab-one-frame :after ((vd QuickTime-vd))
- (#_VDGrabOneFrame (component-instance vd))
- )
-
-
- (defmethod vd-set-dest-rect ((vd QuickTime-vd) topLeft BotRight)
- (rlet ((r :Rect
- :topLeft topLeft
- :botRight botRight))
-
- (#_VDSetPlayThruDestination
- (component-instance vd)
- (pref (dest-wptr vd) :CGrafPort.portPixMap)
- r
- (%null-ptr)
- (%null-ptr))
- ))
-
-
- #|
-
-
- |#